<?php

namespace app\http\middleware;

use think\facade\Session;
use think\Controller;
class AdminCheck extends Controller
{
    public function handle($request, \Closure $next)
    {
        if (empty(Session::get('admin'))&&empty(Session::get('teacher'))){
            $this->error('请登录','/admin/login','',2);
        }
        return $next($request);
    }
}
